function Message(msg, duration) {
  duration = isNaN(duration) ? 3000 : duration;
  var m = document.createElement('div');
  m.innerHTML = msg;
  m.style.cssText = "font-size: .32rem;color: rgb(255, 255, 255);background-color: rgba(0, 0, 0, 0.6);padding: 10px 15px;border-radius: 4px;position: fixed; top: 20px;left: 50%;transform:translateX(-50%);text-align: center;";
  document.body.appendChild(m);
  setTimeout(function () {
    var d = 0.5;
    m.style.opacity = '0';
    setTimeout(function () { document.body.removeChild(m) }, d * 1000);
  }, duration);
}  
